<template>
  <el-card shadow="never">
    <div slot="header">
      <el-button @click="$router.push({ name: 'monitorIndex'})">返回</el-button>
    </div>
    <e-table
      ref="eTable"
      :tableData="tableData"
      :columns="columns"
      :loading="loading"
      :pageObj="null"
      :border="null"
    />
  </el-card>
</template>

<script>
import { getPatrolListDetail } from '@/api/monitor'
import { getMonitorTime } from '@/utils/util'

export default {
  data() {
    return {
      tableData: [],
      columns: [
        {
          label: '账期',
          prop: 'dateCd'
        },
        {
          label: '执行科室',
          prop: 'deptName'
        },
        {
          label: '巡查任务',
          prop: 'taskTitle'
        },
        {
          label: '被巡查对象',
          prop: 'targetName'
        },
        {
          label: '巡查次数',
          prop: 'evalNum'
        }
      ],
      loading: false,
      row: JSON.parse(this.$route.query.row)
    }
  },
  async created() {
    let param = getMonitorTime()
    console.log('row', this.row)

    const res = await getPatrolListDetail({ ...param, deptId: this.row.execDeptId })
    console.log('res', res)
    if (res.state === '000000') {
      this.tableData = res.data
    }
  }
}
</script>
